package engine.utils
{
	public class Command
	{
		/**
		 * Creates a new Function from a given function and a list of extra arguments for the
		 * new Function to have added to its arguments.
		 * 
		 * @param Handler: A Function.
		 * @param Args: A list of extra arguments.
		 * @return A Function with the added arguments.
		 */
		public static function create(handler:Function, ...args):Function
		{
			return function(...innerArgs):*
			{
				return handler.apply(this, innerArgs.concat(args));
			}
		}
	}
}